
/**
 * 
 */
package com.zsrt.day20170411.homework;

/**
 * @author jmj
 * @date 2017年4月11日
 * @time 下午3:49:29
 */
public class Student {
	
	public String name;
	
	public int age;
	
	public int score;
	
	
	public char sex;

	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}


	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}


	/**
	 * @return the age
	 */
	public int getAge() {
		return age;
	}


	/**
	 * @param age the age to set
	 */
	public void setAge(int age) {
		this.age = age;
	}


	/**
	 * @return the score
	 */
	public int getScore() {
		return score;
	}


	/**
	 * @param score the score to set
	 */
	public void setScore(int score) {
		this.score = score;
	}


	/**
	 * @return the idCard
	 *//*
	public long getIdCard() {
		return idCard;
	}


	*//**
	 * @param idCards the idCard to set
	 *//*
	public void setIdCard(long idCards) {
		this.idCard = idCards;
	}*/


	/**
	 * @return the sex
	 */
	public char getSex() {
		return sex;
	}


	/**
	 * @param sex the sex to set
	 */
	public void setSex(char sex) {
		this.sex = sex;
	}

	/**
	 * 打印个人信息
	 * @return
	 */
	public String info() {
		return "Student [name=" + name + ", age=" + age + ", score=" + score + ", " /*idCard=" + idCard + ", */ +"sex="+ sex
				+ "]";
	}
	
	/**
	 * 判断有多少人的分数在70~80之间
	 * @param newStudents.score
	 * @param target1
	 * @param target2
	 * @return
	 */
	public int panDuan(Student[] newStudents){
		int count=0;
		for(int index=0;index<newStudents.length;index++){
			int score =newStudents[index].getScore();
			if(score >=70 && score <=80){
				count++;
			}
		}
		return count;
	}
	
	/**
	 * 判断及格的人是谁
	 * @param scores
	 * @return
	 */
	public void jiGe(Student[] newStudents){
		System.out.println("及格的人是");
		for(int index=0;index<newStudents.length;index++){
			int score =newStudents[index].getScore();
			String name = newStudents[index].getName();
			if(score >=60){
				System.out.println(name);
			}
		}
	
	}
	
	/**
	 * 判断谁的分数个位上是6
	 * @param scores
	 * @param names
	 */
	public void fs6(Student[] newStudents){
		System.out.println("这些人的个位数是6");
		for(int index=0;index<newStudents.length;index++){
			int score =newStudents[index].getScore();
			String name = newStudents[index].getName();
			if(score %10 ==6){
				System.out.println(name);
			}
			
		}
	}
	
	/**
	 * 判断男生，女生各有多少人
	 * @param sexs
	 */
	public void xb(Student[] newStudents){
		int nan = 0;
		int nv  = 0;
		for(int index=0;index<newStudents.length;index++){
			int sex = newStudents[index].getSex();
			if(sex =='男'){
				nan++;
			}else{
				nv++;
			}
		}
		System.out.println("男生有"+nan);
		System.out.println("女生有"+nv);
	}


	/**
	 * 构造方法
	 * @param name
	 * @param age
	 * @param score
	 * @param sex
	 */
	public Student(String name, int age, int score, char sex) {
		super();
		this.name = name;
		this.age = age;
		this.score = score;
		this.sex = sex;
	}


	/**
	 * 
	 */
	public Student() {
		super();
	}
	
	
}
